<template>
	<el-descriptions ref="ruleFormRef" :column="2" direction="vertical" v-loading="isLoading">

		<el-descriptions-item width="50%" label='设备别名'>
			{{ isNullOrEmpty( formInline?.deviceName ) }}
		</el-descriptions-item>
		<el-descriptions-item width="50%" label='设备序列号'>
			{{ isNullOrEmpty( formInline?.deviceSN  ) }}
		</el-descriptions-item>
		<el-descriptions-item width="50%" label='所在位置'>
			{{ isNullOrEmpty( formInline?.place  ) }}
		</el-descriptions-item>
		<el-descriptions-item width="50%" label='告警类别'>
			<!-- {{ isNullOrEmpty( ALARMTYPES[formInline.alarmType]?.label ?? '--' ) }} -->
			<el-tag :type="ALARMTYPES[formInline.alarmType]?.type">{{ isNullOrEmpty( ALARMTYPES[formInline.alarmType]?.label ) }}</el-tag>
		</el-descriptions-item>
		<el-descriptions-item width="50%" label='告警事件'>
			{{ isNullOrEmpty( formInline?.alarmTitle  ) }}
		</el-descriptions-item>
		<el-descriptions-item width="50%" label='告警时间'>
			{{ isNullOrEmpty( formInline?.createdAt  ) }}
		</el-descriptions-item>
	</el-descriptions>
</template>

<script setup lang="ts">
import { isNullOrEmpty } from '@/utils/functions'
import { ref } from "vue";
import { titles } from './index';
import type { infoType } from '@/api/manage/Individual-management/alarm-log/index';
import { ALARMTYPES } from "@/constant/alarm-mangenment";

type FormProps = {
	formInline: infoType,
	isLoading: boolean
}

const props = withDefaults(defineProps<FormProps>(), {
	formInline: () => ({} as infoType),
	isLoading: false
});

const ruleFormRef = ref();
//  const newFormInline = ref(props.formInline as any);
//
//
//  watch(()=>props.formInline,()=>{
//  	newFormInline.value = props.formInline
//  },{
//  	deep:true,
//  	immediate:true
//  })

function getRef() {
	return ruleFormRef.value;
}

defineExpose({ getRef });
</script>
